package com.lantosec.hmrp.modules.warning.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.warning.vo.WarningEvalNoteVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 处置奖惩记录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarningEvalNote extends BaseEntity<WarningEvalNoteVO> {

    private static final long serialVersionUID = 1L;
    public WarningEvalNote(WarningEvalNoteVO vo){
        this.noteId = vo.getNoteId();
        this.dataId = vo.getDataId();
        this.ruleId = vo.getRuleId();
        this.dataTime = vo.getDataTime();
        this.evalItemId = vo.getEvalItemId();
        this.rewardOrientation = vo.getRewardOrientation();
        this.rewardType = vo.getRewardType();
        this.rewardValue = vo.getRewardValue();
        this.targetMode = vo.getTargetMode();
        this.targetId = vo.getTargetId();
        this.targetName = vo.getTargetName();
        this.handleRemark = vo.getHandleRemark();
        this.violateFlag = vo.getViolateFlag();
        this.handleUserId = vo.getHandleUserId();
        this.handleUser = vo.getHandleUser();
        this.rewardArr = vo.getRewardArr();
        this.warningFlag = vo.getWarningFlag();
    }

    @Override
    public WarningEvalNoteVO convertToVO(){
        return new WarningEvalNoteVO(this);
    }


    /**
     * 处置奖惩记录ID
     */
    @TableId(value = "note_id", type = IdType.AUTO)
    private Integer noteId;

    /**
     * 预警数据ID
     */
    private Integer dataId;

    /**
     * 预警规则ID
     */
    private String ruleId;

    /**
     * 预警数据时间
     */
    private String dataTime;

    /**
     * 处置标准(考评项目ID)
     */
    private String evalItemId;

    /**
     * 项目类型(1分 2钱)
     */
    private Integer rewardOrientation;

    /**
     * 奖惩形式(1奖 2惩)
     */
    private Integer rewardType;

    /**
     * 奖惩值(正为加 负为扣)
     */
    private BigDecimal rewardValue;

    /**
     * 责任队形类型(1部门 2个人)
     */
    private Integer targetMode;

    /**
     * 责任对象ID
     */
    private String targetId;

    /**
     * 责任对象
     */
    private String targetName;

    /**
     * 处置说明
     */
    @TableField(exist = false)
    private String handleRemark;

    /**
     * 是否违规
     */
    @TableField(exist = false)
    private Integer violateFlag;

    /**
     * 处置人ID
     */
    @TableField(exist = false)
    private String handleUserId;

    /**
     * 处置人
     */
    @TableField(exist = false)
    private String handleUser;

    /**
     * 考评项
     */
    @TableField(exist = false)
    private List rewardArr;

    /**
     * 区分pc跟app  null为pc，1为app
     */
    @TableField(exist = false)
    private Integer warningFlag;


    public enum ColName {
        note_id, data_id, rule_id, data_time, eval_item_id, reward_orientation, reward_type, reward_value, target_mode, target_id, target_name, remark, 
    }
}
